#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>
#include <string>

#include "fileoper.h"

using namespace std;
struct IndexAndStuName
{
    IndexAndStuName()
    {
        Index_ = 0;
    }
    int Index_;
    StuInfo si;
};

class SrandSvr
{
public:
    SrandSvr();

    ~SrandSvr();

    int OnInit(const string& ConfigName, const string& CyclCount);
    string CalcRandName(int Randcount);
    int JudgeStuName(const string& StuName);
    string InnerCalcRandName();
    
    void ShowStuData();
private:
    int WriteToFile();
private:
    //保存初次选中的童鞋的信息
    vector<IndexAndStuName> IndexAndStuNameVec_;
    //文件操作指针
    FileOperSer* FileOper_;
    //抽到的同学的对应在map中的key
    int Indexformap_;
};
